package com.qf.bookshop2.service.impl;

import com.qf.bookshop2.mapper.PermisstionMapper;
import com.qf.bookshop2.model.Permisstion;
import com.qf.bookshop2.service.PermisstionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class PermisstionServiceImpl implements PermisstionService {

    @Autowired
    PermisstionMapper mapper;

    @Override
    public List<String> getPermisstionStringList(String username) {
        List<Permisstion> permisstions = mapper.selectPermsByUsername(username);
        List<String> list=new ArrayList<>();
        for(Permisstion p:permisstions){
            list.add(p.getPermisstionName());
        }
        return list;
    }
}
